package test.myProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author fanhb on 2017/8/18
 * @desc xxxx
 */
public class MyJDKProxyHandler implements InvocationHandler{

    private Object target;

    public MyJDKProxyHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {



        System.out.println("before");
        System.out.println(proxy.getClass());
        System.out.println(proxy.getClass().getSuperclass());
        method.invoke(target,args);
        System.out.println("after");
        System.out.println("===="+proxy.getClass());
//        System.out.println(proxy);
        return "sssssss";
    }







}



